import { createApp } from 'vue'
import App from './App.vue'
import 'amfe-flexible'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'   // 持久化插件
import Footer from './components/Footer.vue'

import './common/css/base.less'

// createApp(App).mount('#app')
const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus)

app.use(router)

const pinia = createPinia() // 集中管理状态
pinia.use(piniaPluginPersistedstate) // 安装持久化插件
app.use(pinia)

app.component('Footer', Footer)

app.mount('#app')
